﻿using System;

namespace Lang.Php
{
    [Flags]
    public enum ErrorLevel
    {
        /// <summary>
        /// Fatal run-time errors. These indicate errors that can not be recovered from, such as a memory allocation problem. Execution of the script is halted. 
        /// </summary>
        [RenderValue("E_ERROR")]
        Error = 1,

        /// <summary>
        /// Run-time warnings (non-fatal errors). Execution of the script is not halted. 
        /// </summary>
        [RenderValue("E_WARNING")]
        Warning = 2,


        /// <summary>
        /// Compile-time parse errors. Parse errors should only be generated by the parser. 
        /// </summary>
        [RenderValue("E_PARSE")]
        Parse = 4,


        /// <summary>
        /// Run-time notices. Indicate that the script encountered something that could indicate an error, but could also happen in the normal course of running a script. 	 
        /// </summary>
        [RenderValue("E_NOTICE")]
        Notice = 8,

        /// <summary>
        /// Fatal errors that occur during PHP's initial startup. This is like an E_ERROR, except it is generated by the core of PHP.
        /// </summary>
        [RenderValue("E_CORE_ERROR")]
        CoreError = 16,

        /// <summary>
        /// Warnings (non-fatal errors) that occur during PHP's initial startup. This is like an E_WARNING, except it is generated by the core of PHP.
        /// </summary>
        [RenderValue("E_CORE_WARNING")]
        CoreWarning = 32,

        /// <summary>
        /// Fatal compile-time errors. This is like an E_ERROR, except it is generated by the Zend Scripting Engine. 
        /// </summary>
        [RenderValue("E_COMPILE_ERROR")]
        CompileError = 64,

        /// <summary>
        /// Compile-time warnings (non-fatal errors). This is like an E_WARNING, except it is generated by the Zend Scripting Engine. 
        /// </summary>
        [RenderValue("E_COMPILE_WARNING")]
        CompileWarning = 128,

        /// <summary>
        /// User-generated error message. This is like an E_ERROR, except it is generated in PHP code by using the PHP function trigger_error(). 
        /// </summary>
        [RenderValue("E_USER_ERROR")]
        UserError = 256,

        /// <summary>
        /// User-generated warning message. This is like an E_WARNING, except it is generated in PHP code by using the PHP function trigger_error(). 
        /// </summary>
        [RenderValue("E_USER_WARNING")]
        UserWarning = 512,

        /// <summary>
        /// User-generated notice message. This is like an E_NOTICE, except it is generated in PHP code by using the PHP function trigger_error(). 
        /// </summary>
        [RenderValue("E_USER_NOTICE")]
        UserNotice = 1024,

        /// <summary>
        /// Enable to have PHP suggest changes to your code which will ensure the best interoperability and forward compatibility of your code. 
        /// </summary>
        [RenderValue("E_STRICT")]
        Strict = 2048,

        /// <summary>
        /// Catchable fatal error. It indicates that a probably dangerous error occured, but did not leave the Engine in an unstable state. If the error is not caught by a user defined handle (see also set_error_handler()), the application aborts as it was an E_ERROR. 
        /// </summary>
        [Since("5.2.0")]
        [RenderValue("E_RECOVERABLE_ERROR")]
        RecoverableError = 4096,

        /// <summary>
        /// Run-time notices. Enable this to receive warnings about code that will not work in future versions. 
        /// </summary>
        [RenderValue("E_DEPRECATED ")]
        [Since("5.3.0")]
        Deprecated = 8192,

        /// <summary>
        /// User-generated warning message. This is like an E_DEPRECATED, except it is generated in PHP code by using the PHP function trigger_error(). 
        /// </summary>
        [RenderValue("E_USER_DEPRECATED ")]
        [Since("5.3.0")]
        UserDeprecated = 16384,


        /// <summary>
        /// All errors and warnings, as supported, except of level E_STRICT prior to PHP 5.4.0. 
        /// </summary>
        [RenderValue("E_ALL")]
        [Since("5.4.0")]
        All = 32767,

        [RenderValue("E_ALL")]
        [Since("5.3.0")]
        AllPhp53X = 30719
    }
}
